package com.by.feign.client;


import com.by.feign.dto.UserDto;
import com.by.feign.fallback.UserRemoteClientFallback;
import com.by.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户远程客户端
 */
@FeignClient(value = "service-system",fallback = UserRemoteClientFallback.class)
public interface UserRemoteClient {


    /**
     * 根据用户id查询用户信息
     * @param id 用户id
     * @return 用户信息
     */
    @GetMapping("/user")
    Result<UserDto> getUserById(@RequestParam("id") int id);

}
